﻿// dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"

#include <gdiplus.h>
using namespace Gdiplus;
//#pragma comment(lib,"Gdiplus.lib")

////for gdiplus initialization
ULONG_PTR m_gdiplusToken;

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
	////for gdiplus initialization
	GdiplusStartupInput gdiplusStartupInput;

	switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
		//VERIFY(GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL) == Ok);
		GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);
		break;
	case DLL_THREAD_ATTACH:
		break;
	case DLL_THREAD_DETACH:
		break;
	case DLL_PROCESS_DETACH:
		GdiplusShutdown(m_gdiplusToken);
        break;
    }
    return TRUE;
}

